NetworkApi
interface NetworkApi
API for multiloader abstraction of simple play-phase networking
Author
fzzyhmstrs
Since
0.4.1
Functions
Link copied to clipboard
abstract fun <T : FzzyPayload> registerC2S(id: Identifier, clazz: Class<T>, function: Function<PacketByteBuf, T>, handler: C2SPayloadHandler<T>)
registers a server-bound (C2S) payload type and receipt handler. This must be done on both logical sides (client and server). A common entrypoint is typically the best place for this.
Link copied to clipboard
abstract fun <T : FzzyPayload> registerS2C(id: Identifier, clazz: Class<T>, function: Function<PacketByteBuf, T>, handler: S2CPayloadHandler<T>)
registers a client-bound (S2C) payload type and receipt handler. This must be done on both logical sides (client and server). A common entrypoint is typically the best place for this.
Link copied to clipboard
Sends a payload to a receiver. If the server player is defined, will be an S2C transmission, otherwise C2S